/*
 *  $Id: Deck.cs 1217 2010-11-27 10:48:54Z thenn.erannor $
 *	This file is a part of Ragima CCG.
 *	(C) 2008-2010 Ragima development group.
 *
 *	Licensed under the terms of the GNU GPL License version 2.
 *
 */

using Nereal.Serialization;

namespace Ragima.Events {
    [TypeId("deck")]
    public class Deck : DirectConnectEvent {
        [Serialize, XmlName("deck")]
        private CardDeck _deck;

        public Deck() {
            _deck = new CardDeck();
        }
        public Deck(CardDeck deck) {
            _deck = deck.Copy();
        }

        protected override void ExecuteInner(DirectConnectScene scene) {
            if (Remote) {
                scene.Mode.Player2.Deck = _deck;
                 scene.Log.Add(Resources.Deck.ReceivedEnemyDeck, _deck.MainElement);
            }
        }
    }
}
